import { uIsFindColors } from './index'

export default function (colors = [], t, img) {
  let is = null;

  // ! 找到为止
  while (true) {
    is = uIsFindColors(colors, t, img);

    if (is) break;
  }

  sleep(500);

  click(colors[0].x, colors[0].y);

  sleep(500);

  if (uIsFindColors(colors, t, img)) {
    click(colors[0].x, colors[0].y);
  }

  return is;
}
